inset

Returns a copy of this instance inset in the given directions. This is intended for dispatching insets to areas of the window that are smaller than the current area.

Example:

childView.dispatchApplyWindowInsets(insets.inset(childMargins));

Parameters

insets

the amount of insets to remove from all sides.

See also


open fun inset(@IntRange(from = 0) left: Int, @IntRange(from = 0) top: Int, @IntRange(from = 0) right: Int, @IntRange(from = 0) bottom: Int): WindowInsetsCompat(source)

Returns a copy of this instance inset in the given directions. This is intended for dispatching insets to areas of the window that are smaller than the current area.

Example:

childView.dispatchApplyWindowInsets(insets.inset(
        childMarginLeft, childMarginTop, childMarginBottom, childMarginRight));

Return

the inset insets

Parameters

left

the amount of insets to remove from the left. Must be non-negative.

top

the amount of insets to remove from the top. Must be non-negative.

right

the amount of insets to remove from the right. Must be non-negative.

bottom

the amount of insets to remove from the bottom. Must be non-negative.